{if empty($_W['isajax'])}
{template 'common/top'}
{/if}
  <!-- Content Wrapper. Contains page content -->
  <div class="content-wrapper">
	  <div class="base_topBar ">
		  <div class="base_explain">
			  <span id="toolbar_title">导航管理</span>
			  <div class="warn_info_box clearfix">
			  </div>
		  </div>
		  <div class="base_topBar_right">
			  <div class="operate_items clearfix">
				  <div class="user_feedBack operate_item">
					  <a href="#" class="userFeedbackClick">
						  用户反馈
					  </a>
				  </div>
			  </div>
		  </div>
	  </div>
    <!-- Main content -->
    <section class="content">
      <div class="row">
        <div class="col-xs-12">
          <div class="box">
            <div class="box-header with-border">
				<a href="{php echo $this->createWebUrl('navigate',array('act'=>'edit'))}" class="waves-effect waves-light btnMid btnBlue completeBtn">新增图标</a>
				<a data-href="{php echo $this->createWebUrl('navigate',array('act'=>'mutdelete'))}" href="javascript:;" class="waves-effect waves-light btnMid btnRed completeBtn mutdelete">删除选中</a>
            </div>
            <!-- /.box-header -->
            <div class="box-body">
              <table id="example2" class="table table-hover">
                <thead>
                <tr>
                    <th style="width:3em;">
                        <input type="checkbox" id="checkall"/>
                    </th>
                    <th style="width:10%;">序号</th>
                    <th style="width:20%;">标题</th>
					<th style="width:15%;">图标</th>
                    <th style="width:25%;">创建日期</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                {loop $list['list'] $li}
                <tr>
                    <td><input type="checkbox" name="ids[]" value="{$li['id']}"/></td>
                    <td>{$li['sort']}</td>
                    <td>{$li['name']}</td>
					<td><img src="{$li['image']}" alt="" style="width:40px;height:40px;"></td>
					<td>{php echo date('Y-m-d H:i:s',$li['create_time'])}</td>
                    <td>
                        <a href="{php echo $this->createWebUrl('navigate',array('act'=>'edit','id'=>$li['id']))}" >编辑</a>
						<a href="javascript:void(0);" style="cursor: default;">|</a>
                        <a href="{php echo $this->createWebUrl('navigate',array('act'=>'delete','id'=>$li['id']))}" onclick="return window.confirm('您确定要删除吗？');">删除</a>
                    </td>
                </tr>
                {/loop}
                </tbody>
              </table>
            </div>
			<div class="box-footer">
				{php echo $list['pager']}
			</div>
            <!-- /.box-body -->
          </div>
          <!-- /.box -->
        </div>
      </div>
      <!-- /.row -->
    </section>
    <!-- /.content -->
  </div>
</div>
<!-- ./wrapper -->

{if empty($_W['isajax'])}
{template 'common/foot'}
<script type="text/javascript">
	$('.mutdelete').click(function(){
		var url = $(this).data('href');
		var ids = [];
		var idss = [];
		$('input:checkbox[name="ids[]"]').each(function() {
			var _that = $(this)[0];
			if(_that.checked){
				ids = ids.concat($(this).val());
			}else{
				idss = idss.concat($(this).val());
			}
		});
		console.log(ids);
		if(confirm("您确定要删除么？")){
			$.post(url,{ids:ids},function(data){
				util.message("删除成功","{php echo $_W['siteurl']}",'success');
			},'json');
		}
	});
	$('.unmutdelete').click(function(){
		var ids = [];
		var idss = [];
		$('input:checkbox[name="ids[]"]').each(function() {
			var _that = $(this)[0];
			if(_that.checked){
				ids = ids.concat($(this).val());
			}else{
				idss = idss.concat($(this).val());
			}
		});
		console.log(idss);
		if(confirm("您确定要删除么？")){
			$.post(url,{ids:idss},function(data){
				util.message("删除成功","{php echo $_W['siteurl']}",'success');
			},'json');
		}
	})
	$("#checkall").click(function(){
		console.log('checkall');
		$('input[name="ids[]"').each(function(){
			var _that = $(this)[0];
			if(_that.checked){
				_that.checked = false;
			}else{
				_that.checked = true;
			}
		});
	});
</script>
{/if}